
<!--[securityutil_checkpermission_block component='VotePetition::' instance='::' level=ACCESS_ADD]-->
  <style type="text/css">
  .ui-datepicker-div, .ui-datepicker-inline, #ui-datepicker-div {font:10px Tahoma, Geneva, sans-serif;}
  </style>	
  <script language="javascript" src="modules/VotePetition/pnajax/ajax_form_house_no.js"></script>
  <script type="text/javascript">
      function validateForm(form) {
        //Check pro_id
        var pro_id = document.getElementById("form_pro_id_");
        if (pro_id.value == '0') {
            alert("กรุณาเลือกจังหวัด");
            pro_id.style.borderStyle = "solid";
            pro_id.style.borderColor = "#FF0000";
            pro_id.style.borderWidth = "1px";
            pro_id.focus();
            return false;
        }else{
            pro_id.style.borderStyle = "solid";
            pro_id.style.borderColor = "#00CC00";
            pro_id.style.borderWidth = "1px";
        }
        
        var dis_id = document.getElementById("form_dis_id_");
        if (dis_id.value == '0') {
            alert("กรุณาเลือกอำเภอ");
            dis_id.style.borderStyle = "solid";
            dis_id.style.borderColor = "#FF0000";
            dis_id.style.borderWidth = "1px";
            dis_id.focus();
            return false;
        }else{
            dis_id.style.borderStyle = "solid";
            dis_id.style.borderColor = "#00CC00";
            dis_id.style.borderWidth = "1px";
        }
        
        var tam_id = document.getElementById("form_tam_id_");
        if (tam_id.value == '0') {
            alert("กรุณาเลือกตำบล");
            tam_id.style.borderStyle = "solid";
            tam_id.style.borderColor = "#FF0000";
            tam_id.style.borderWidth = "1px";
            tam_id.focus();
            return false;
        }else{
            tam_id.style.borderStyle = "solid";
            tam_id.style.borderColor = "#00CC00";
            tam_id.style.borderWidth = "1px";
        }
        
        
        //Check category
        var vil_id = document.getElementById("form_vil_id_");
        if(vil_id){
          if (vil_id.value == '0') {
              alert("กรุณาเลือกหมู่บ้าน");
              vil_id.style.borderStyle = "solid";
              vil_id.style.borderColor = "#FF0000";
              vil_id.style.borderWidth = "1px";
              vil_id.focus();
              return false;
          }else{
              vil_id.style.borderStyle = "solid";
              vil_id.style.borderColor = "#00CC00";
              vil_id.style.borderWidth = "1px";
          }
        }
  /*
        //Check party
        var party = document.getElementById("form_par_id_");
        if (party.value == '0') {
            alert("กรุณาเลือกพรรค ");
            party.style.borderStyle = "solid";
            party.style.borderColor = "#FF0000";
            party.style.borderWidth = "1px";
            party.focus();
            return false;
        }else{
            party.style.borderStyle = "solid";
            party.style.borderColor = "#00CC00";
            party.style.borderWidth = "1px";
        }
  */
        //Check house_no
        var house_no = document.getElementById("no");
        if (house_no.value == '') {
            alert("กรุณาบอกบ้านเลขที่ ");
            house_no.style.borderStyle = "solid";
            house_no.style.borderColor = "#FF0000";
            house_no.style.borderWidth = "1px";
            house_no.focus();
            return false;
        }else{
            house_no.style.borderStyle = "solid";
            house_no.style.borderColor = "#00CC00";
            house_no.style.borderWidth = "1px";
        }

        //Check title
        var title = document.getElementById("title");
        if (title.value == '') {
            alert("กรุณากรอกหัวข้อปัญหา");
            title.style.borderStyle = "solid";
            title.style.borderColor = "#FF0000";
            title.style.borderWidth = "1px";
            title.focus();
            return false;
        }else{
            title.style.borderStyle = "solid";
            title.style.borderColor = "#00CC00";
            title.style.borderWidth = "1px";
        }
        
        //Check latitude
        var latitude = document.getElementById("latitude");
        if (latitude.value == '') {
            alert("Please enter value.");
            latitude.style.borderStyle = "solid";
            latitude.style.borderColor = "#FF0000";
            latitude.style.borderWidth = "1px";
            latitude.focus();
            return false;
        }else{
            document.getElementById('error-title').innerHTML = "";
        }

        //Check longitude
        var longitude = document.getElementById("longitude");
        if (longitude.value == '') {
            alert("Please enter value.");
            longitude.style.borderStyle = "solid";
            longitude.style.borderColor = "#FF0000";
            longitude.style.borderWidth = "1px";
            longitude.focus();
            return false;
        }else{
            document.getElementById('error-longitude').innerHTML = "";
        }

      }
  </script>

  <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
  <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
  <script type="text/javascript">
    var geocoder = new google.maps.Geocoder();

    function geocodePosition(pos) {
      geocoder.geocode({
        latLng: pos
      }, function(responses) {
        if (responses && responses.length > 0) {
          updateMarkerAddress(responses[0].formatted_address);
        } else {
          updateMarkerAddress('Cannot determine address at this location.');
        }
      });
    }

    function updateMarkerStatus(str) {
      document.getElementById('markerStatus').innerHTML = str;
    }

    function updateMarkerPosition(latLng) {

      document.getElementById("latitude").value = latLng.lat();
      document.getElementById("longitude").value = latLng.lng();
      document.getElementById('info').innerHTML = [
        latLng.lat(),
        latLng.lng()
      ].join(', ');


    }

    function updateMarkerAddress(str) {
      document.getElementById('address').innerHTML = str;
    }

    function initialize() {
      <!--[if $form.latitude && $form.longitude]-->
       var latLng = new google.maps.LatLng(<!--[$form.latitude]-->, <!--[$form.longitude]-->);
      <!--[else]-->
       var latLng = new google.maps.LatLng(18.23561180974427,100.16967718749993);
      <!--[/if]-->

      var map = new google.maps.Map(document.getElementById('mapCanvas'), {
          scrollwheel: false,
        zoom: 9,
        center: latLng,
        mapTypeId: google.maps.MapTypeId.HYBRID
      });
      var marker = new google.maps.Marker({
        position: latLng,
        title: '<!--[$form.name]-->',
        map: map,
        draggable: true
      });
      
      // Update current position info.
      updateMarkerPosition(latLng);
      geocodePosition(latLng);
      
      // Add dragging event listeners.
      google.maps.event.addListener(marker, 'dragstart', function() {
        updateMarkerAddress('Dragging...');
      });
      
      google.maps.event.addListener(marker, 'drag', function() {
        updateMarkerStatus('Dragging...');
        updateMarkerPosition(marker.getPosition());
      });
      
      google.maps.event.addListener(marker, 'dragend', function() {
        updateMarkerStatus('Drag ended');
        geocodePosition(marker.getPosition());
      });
    }

    // Onload handler to fire off the app.
    google.maps.event.addDomListener(window, 'load', initialize);
  </script>
  </head>

  <TABLE width="100%"  align="left">
    <TR>
      <TD valign="top" border="1">
          
              <form id='form' 
                    class='form' 
                    action="<!--[pnmodurl modname='VotePetition' type='userform' func='submit' ctrl='Research']-->" 
                    method="post" 
                    onsubmit="return validateForm(this)"
              >
                  <input type="hidden" name="form[id]" value="<!--[$smarty.request.id]-->" />
                  <TABLE width='100%' border="0">
                    <TR>
                      <TD class='td-label' align="left">
                         <b><u><font size="4" color="">
                            ส่วนที่ 1 ข้อมูลทั่วไป
                          </font></u></b>
                      </TD>
                    </TR>
                    <tr>
                      <td>
                        <table align="left">
                          <tr>
                            <td><b>1.ชื่อ&nbsp;:&nbsp;</b>
                              <select name="form[titlename]">
                                <option value="นาย" selected>นาย
                                <option value="นาง">นาง
                                <option value="นางสาว">นางสาว
                                <option value="อื่นๆ">อื่นๆ
                              </select>
                            </td>
                            <td>&nbsp;</td>
                            <td><input type="text" name="form[firstname]"></td>
                            <td>&nbsp;</td>
                            <td><b>นามสกุล</b>&nbsp;:&nbsp;<input type="text" name="form[lastname]"></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                    <tr>
                      <td>
                        <table align="left">
                          <tr>
                            <td><b>2.หมายเลขบัตรประจำตัวประชาชน</b>&nbsp;:&nbsp;<input type="text" name="form[pid]"></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                    <tr>
                      <td>
                        <table align="left">
                          <tr>
                            <td>
                              <b>3.วันเกิด</b>&nbsp;:&nbsp;
                              <input SIZE="15" type="text" name="form[birthdate]"> (2011-12-30)
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                    <tr>
                      <td>
                        <table align="left">
                          <tr>
                            <td>
                              <b>4.ที่อยู่ปัจจุบัน</b>&nbsp;:&nbsp;
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                      <TR>
                        <TD class='td-label' align="left">
                          <table align="left">
                          <tr>
                            <td>
                              &nbsp;&nbsp;&nbsp;&nbsp;
                            </td>
                            <td>
                              จังหวัด&nbsp;:&nbsp;
                            </td>
                            <td>
                          <!--[selector_object_array_ex
                                modname="VotePetition" 
                                class="Province" 
                                field="id" 
                                displayField="name"  
                                name="form[pro_id]" 
                                selectedValue=$form.pro_id 
                                sort="pro_name"
                                onChange="getDistrictByProvinceID()"
                                onClick="getDistrictByProvinceID()"
                                defaultValue="0"
                                defaultText="--------- กรุณาเลือก ---------"
                          ]-->
                          <FONT SIZE="2" COLOR="#FF0000">&nbsp;*</FONT>
                            </td>
                          </tr>
                          </table>
                        </TD>
                      </TR>
                      <TR>
                        <TD class='td-label' align="left">
                          <table align="left">
                          <tr>
                            <td>
                              &nbsp;&nbsp;&nbsp;&nbsp;
                            </td>
                            <td>
                              อำเภอ&nbsp;:&nbsp;
                            </td>
                            <td>
                          <span id="form_district">
                              <!--[if (isset($smarty.request.form.dis_id) || $smarty.request.form.dis_id == 0) && $smarty.request.form.pro_id]-->
                                <!--[selector_object_array_ex modname="VotePetition" 
                                        class="District" 
                                        field="id" 
                                        displayField="name"  
                                        name="form[dis_id]" 
                                        sort="dis_name"
                                        selectedValue=$smarty.request.form.dis_id
                                        queryField = dis_pro_id
                                        queryValue = $smarty.request.form.pro_id
                                        onChange="getTambonByDistrictID()"
                                ]-->
                              <!--[elseif $form.dis_id && $form.pro_id]-->
                                <!--[selector_object_array_ex modname="VotePetition" 
                                        class="District" 
                                        field="id" 
                                        displayField="name"  
                                        name="form[dis_id]" 
                                        sort="dis_name"
                                        selectedValue=$form.pro_id
                                        queryField = dis_pro_id
                                        queryValue = $form.pro_id
                                        onChange="getTambonByDistrictID()"
                                ]-->
                              <!--[else]-->
                              -
                              <!--[/if]-->
                          </span>
                          <div id='error-name'></div>
                            </td>
                          </tr>
                          </table>
                        </TD>
                      </TR>
                      <TR>
                        <TD class='td-label' align="left">
                          <table align="left">
                          <tr>
                            <td>
                              &nbsp;&nbsp;&nbsp;&nbsp;
                            </td>
                            <td>
                              ตำบล&nbsp;:&nbsp;
                            </td>
                            <td>
                              <span id="form_tambon">
                                  <!--[if (isset($smarty.request.form.tam_id) || $smarty.request.form.tam_id == 0) && $smarty.request.form.tam_id]-->
                                    <!--[selector_object_array_ex 
                                            modname="VotePetition" 
                                            class="Tambon" 
                                            field="id" 
                                            displayField="name"  
                                            name="form[tam_id]" 
                                            sort="tam_name"
                                            selectedValue=$smarty.request.form.tam_id
                                            queryField = dis_pro_id
                                            queryValue = $smarty.request.form.tam_id
                                    ]-->
                                  <!--[elseif $form.dis_id && $form.pro_id && $form.tam_id]-->
                                    <!--[selector_object_array_ex 
                                            modname="VotePetition" 
                                            class="Tambon" 
                                            field="id" 
                                            displayField="name"  
                                            name="form[tam_id]" 
                                            sort="tam_name"
                                            selectedValue=$form.tam_id
                                            queryField = tam_dis_id
                                            queryValue = $form.dis_id
                                    ]-->
                                  <!--[else]-->
                                  -
                                  <!--[/if]-->
                              </span>
                            </td>
                          </tr>
                          </table>

                        </TD>
                      </TR>
                      <TR>
                        <TD class='td-label' align="left">
                          <table align="left">
                          <tr>
                            <td>
                              &nbsp;&nbsp;&nbsp;&nbsp;
                            </td>
                            <td>
                              หมู่ที่&nbsp;:&nbsp;
                            </td>
                            <td>
                          <span id="form_village">
                              <!--[if (isset($smarty.request.form.tam_id) || $smarty.request.form.tam_id == 0) && $smarty.request.form.tam_id]-->
                                <!--[selector_object_array_ex 
                                        modname="VotePetition" 
                                        class="Village" 
                                        field="id" 
                                        displayField="moo"  
                                        name="form[vil_id]" 
                                        sort="vil_moo"
                                        selectedValue=$smarty.request.form.vil_id
                                        queryField = vil_tam_id
                                        queryValue = $smarty.request.form.tam_id
                                ]-->
                              <!--[elseif $form.dis_id]-->
                                <!--[selector_object_array_ex 
                                        modname="VotePetition" 
                                        class="Village" 
                                        field="id" 
                                        displayField="moo"  
                                        name="form[vil_id]" 
                                        sort="vil_moo"
                                        selectedValue=$form.vil_id
                                        queryField = vil_tam_id
                                        queryValue = $form.tam_id
                                ]-->
                              <!--[else]-->
                              -
                              <!--[/if]-->
                          </span>
                          <div id='error-name'></div>
                            </td>
                          </tr>
                          </table>
                        </TD>
                      </TR>
                      <TR>
                        <TD class='td-label' align="left">
                          <table align="left">
                            <tr>
                            <td>
                              &nbsp;&nbsp;&nbsp;&nbsp;
                            </td>
                              <td>
                                ชื่อหมู่บ้าน&nbsp;:&nbsp;
                              </td>
                              <td>
                                <input type="text" name="form[village_name]" id="no">
                                <FONT SIZE="2" COLOR="#FF0000">&nbsp;*</FONT>
                                <div id='error-name'></div>
                              </td>
                            </tr>
                          </table>
                        </TD>
                      </TR>
                      <TR>
                        <TD class='td-label' align="left">
                          <table align="left">
                            <tr>
                            <td>
                              &nbsp;&nbsp;&nbsp;&nbsp;
                            </td>
                              <td>
                                บ้านเลขที่&nbsp;:&nbsp;
                              </td>
                              <td>
                                <input type="text" name="form[no]" id="no">
                                <FONT SIZE="2" COLOR="#FF0000">&nbsp;*</FONT>
                                <div id='error-name'></div>
                              </td>
                            </tr>
                          </table>
                        </TD>
                      </TR>
                      <TR>
                        <TD class='td-label' align="left">
                          <table align="left">
                            <tr>
                            <td>
                              &nbsp;&nbsp;&nbsp;&nbsp;
                            </td>
                              <td>
                                ซอย
                                &nbsp;:&nbsp;
                              </td>
                              <td>
                                <input type="text" name="form[soi]" id="no">
                                <FONT SIZE="2" COLOR="#FF0000">&nbsp;*</FONT>
                                <div id='error-name'></div>
                              </td>
                            </tr>
                          </table>
                        </TD>
                      </TR>
                      <TR>
                        <TD class='td-label' align="left">
                          <table align="left">
                            <tr>
                            <td>
                              &nbsp;&nbsp;&nbsp;&nbsp;
                            </td>
                              <td>
                                ถนน
                                &nbsp;:&nbsp;
                              </td>
                              <td>
                                <input type="text" name="form[road]" id="no">
                                <FONT SIZE="2" COLOR="#FF0000">&nbsp;*</FONT>
                                <div id='error-name'></div>
                              </td>
                            </tr>
                          </table>
                        </TD>
                      </TR>
                      <TR>
                        <TD class='td-label' align="left">
                          <table align="left">
                            <tr>
                            <td>
                              &nbsp;&nbsp;&nbsp;&nbsp;
                            </td>
                              <td>
                                รหัสไปรษณีย์
                                &nbsp;:&nbsp;
                              </td>
                              <td>
                                <input type="text" name="form[zipcode]" id="no">
                                <FONT SIZE="2" COLOR="#FF0000">&nbsp;*</FONT>
                                <div id='error-name'></div>
                              </td>
                            </tr>
                          </table>
                        </TD>
                      </TR>
                      <TR>
                        <TD class='td-label' align="left">
                          <table align="left">
                            <tr>
                            <td>
                              &nbsp;&nbsp;&nbsp;&nbsp;
                            </td>
                              <td>
                                โทรศัพท์
                                &nbsp;:&nbsp;
                              </td>
                              <td>
                                <input type="text" name="form[telephone]" id="no">
                                <FONT SIZE="2" COLOR="#FF0000">&nbsp;*</FONT>
                                <div id='error-name'></div>
                              </td>
                            </tr>
                          </table>
                        </TD>
                      </TR>
                      <TR>
                        <TD class='td-label' align="left">
                          <table align="left">
                            <tr>
                            <td>
                              &nbsp;&nbsp;&nbsp;&nbsp;
                            </td>
                              <td>
                                โทรสาร
                                &nbsp;:&nbsp;
                              </td>
                              <td>
                                <input type="text" name="form[fax]" id="no">
                                <FONT SIZE="2" COLOR="#FF0000">&nbsp;*</FONT>
                                <div id='error-name'></div>
                              </td>
                            </tr>
                          </table>
                        </TD>
                      </TR>
                      <TR>
                        <TD class='td-label' align="left">
                          <table align="left">
                            <tr>
                            <td>
                              &nbsp;&nbsp;&nbsp;&nbsp;
                            </td>
                              <td>
                                มือถือ
                                &nbsp;:&nbsp;
                              </td>
                              <td>
                                <input type="text" name="form[mobile]" id="no">
                                <FONT SIZE="2" COLOR="#FF0000">&nbsp;*</FONT>
                                <div id='error-name'></div>
                              </td>
                            </tr>
                          </table>
                        </TD>
                      </TR>
                    <tr>
                      <td>
                        <table align="left">
                          <tr>
                            <td>
                              <b>5.จำนวนสมาชิกในครัวเรือน</b>
                            </td>
                          </tr>
                          <tr>
                            <td>
                        &nbsp;&nbsp;&nbsp;&nbsp;สมาชิกทั้งหมด 
                            </td>
                            <td><input type="text" size=2 name="form[amount_person]"></td>
                            <td>&nbsp;คน</td>
                          </tr>
                          <tr>
                            <td>
                              &nbsp;&nbsp;&nbsp;&nbsp;บุตรที่กำลังศึกษา                          </td>
                            <td><input type="text" size=2 name="form[student_person]"></td>
                            <td>&nbsp;คน</td>
                          </tr>
                          <tr>
                            <td>
                              &nbsp;&nbsp;&nbsp;&nbsp;บุตรที่ประกอบอาชีพแล้ว                          </td>
                            <td><input type="text" size=2 name="form[career_person]"></td>
                            <td>&nbsp;คน</td>
                          </tr>
                          <tr>
                            <td>
                              <table align="left">
                                <tr>
                                  <td>
                                  &nbsp;&nbsp;&nbsp;&nbsp; 
                                  </td>
                                  <td>5.1 ชื่อ&nbsp;:&nbsp;
                                    <select name="person_in_house[0][titlename]">
                                      <option value="นาย" selected>นาย
                                      <option value="นาง">นาง
                                      <option value="นางสาว">นางสาว
                                      <option value="อื่นๆ">อื่นๆ
                                    </select>
                                  </td>
                                  <td>&nbsp;</td>
                                  <td><input type="text" name="person_in_house[0][firstname]"></td>
                                  <td>&nbsp;</td>
                                  <td>นามสกุล&nbsp;:&nbsp;<input type="text" name="person_in_house[0][lastname]"></td>
                                </tr>
                              </table>
                            </td>
                          </tr>
                          <tr>
                            <td>
                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;วันเกิด&nbsp;:&nbsp;
                              <input SIZE="15" type="text" name="person_in_house[0][birthdate]"> (2011-12-30)
                            </td>
                          </tr>
                          <tr>
                            <td>
                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;กำลังศึกษาชั้น/ประำกอบอาชีพ&nbsp;:&nbsp;
                              <input SIZE="15" type="text" name="person_in_house[0][career]">
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                    <!-- End one person -->
                          <tr>
                            <td>
                              <table align="left">
                                <tr>
                                    <td>
                                &nbsp;&nbsp;&nbsp;&nbsp; 
                                    </td>
                                  <td>5.2 ชื่อ&nbsp;:&nbsp;
                                    <select name="person_in_house[1][titlename]">
                                      <option value="นาย" selected>นาย
                                      <option value="นาง">นาง
                                      <option value="นางสาว">นางสาว
                                      <option value="อื่นๆ">อื่นๆ
                                    </select>
                                  </td>
                                  <td>&nbsp;</td>
                                  <td><input type="text" name="person_in_house[1][firstname]"></td>
                                  <td>&nbsp;</td>
                                  <td>นามสกุล&nbsp;:&nbsp;<input type="text" name="person_in_house[1][lastname]"></td>
                                </tr>
                              </table>
                            </td>
                          </tr>
                          <tr>
                            <td>
                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;วันเกิด&nbsp;:&nbsp;
                              <input SIZE="15" type="text" name="person_in_house[1][birthdate]"> (2011-12-30)
                            </td>
                          </tr>
                          <tr>
                            <td>
                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;กำลังศึกษาชั้น/ประำกอบอาชีพ&nbsp;:&nbsp;
                              <input SIZE="15" type="text" name="person_in_house[1][career]">
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                          <tr>
                            <td>
                              <table align="left">
                                <tr>
                                    <td>
                                &nbsp;&nbsp;&nbsp;&nbsp; 
                                    </td>
                                  <td>5.3 ชื่อ&nbsp;:&nbsp;
                                    <select name="person_in_house[2][titlename]">
                                      <option value="นาย" selected>นาย
                                      <option value="นาง">นาง
                                      <option value="นางสาว">นางสาว
                                      <option value="อื่นๆ">อื่นๆ
                                    </select>
                                  </td>
                                  <td>&nbsp;</td>
                                  <td><input type="text" name="person_in_house[2][firstname]"></td>
                                  <td>&nbsp;</td>
                                  <td>นามสกุล&nbsp;:&nbsp;<input type="text" name="person_in_house[2][lastname]"></td>
                                </tr>
                              </table>
                            </td>
                          </tr>
                          <tr>
                            <td>
                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;วันเกิด&nbsp;:&nbsp;
                              <input SIZE="15" type="text" name="person_in_house[2][birthdate]"> (2011-12-30)
                            </td>
                          </tr>
                          <tr>
                            <td>
                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;กำลังศึกษาชั้น/ประำกอบอาชีพ&nbsp;:&nbsp;
                              <input SIZE="15" type="text" name="person_in_house[2][career]">
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>

                          <tr>
                            <td>
                              <table align="left">
                                <tr>
                                    <td>
                                &nbsp;&nbsp;&nbsp;&nbsp; 
                                    </td>
                                  <td>5.4 ชื่อ&nbsp;:&nbsp;
                                    <select name="person_in_house[3][titlename]">
                                      <option value="นาย" selected>นาย
                                      <option value="นาง">นาง
                                      <option value="นางสาว">นางสาว
                                      <option value="อื่นๆ">อื่นๆ
                                    </select>
                                  </td>
                                  <td>&nbsp;</td>
                                  <td><input type="text" name="person_in_house[3][firstname]"></td>
                                  <td>&nbsp;</td>
                                  <td>นามสกุล&nbsp;:&nbsp;<input type="text" name="person_in_house[3][lastname]"></td>
                                </tr>
                              </table>
                            </td>
                          </tr>
                          <tr>
                            <td>
                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;วันเกิด&nbsp;:&nbsp;
                              <input SIZE="15" type="text" name="person_in_house[3][birthdate]"> (2011-12-30)
                            </td>
                          </tr>
                          <tr>
                            <td>
                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;กำลังศึกษาชั้น/ประำกอบอาชีพ&nbsp;:&nbsp;
                              <input SIZE="15" type="text" name="person_in_house[3][career]">
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </TABLE>
          
      </TD>
    </TR>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
    <TR>
      <TD valign="top" border="1">
            <TABLE width='100%' border="0" align="left">
              <TR>
                <TD class='td-label' align="left">
                   <b><u><font size="4" color="">
                      ส่วนที่ 2 การประกอบอาชีพ
                    </font></u></b>
                </TD>
              </TR>
              <TR>
                <TD class='td-label' align="left">
                  <table align="left">
                    <tr>
                      <td>(<input type="checkbox" name="">)เพาะปลูก</td>
                      <td>พืชที่ปลูก</td>
                      <td><input type="text" name="career[agriculture_type]">&nbsp;&nbsp;</td>
                      <td>จำนวน</td>
                      <td><input type="text" name="career[agriculture_amount]"></td>
                      <td>ไร่&nbsp;&nbsp;</td>
                      <td>ผลผลิต/ปี</td>
                      <td><input type="text" name="career[agriculture_product]"></td>
                      <td>กิโลกรัม</td>
                    </tr>
                  </table>
                </TD>
              </TR>
              <TR>
                <TD class='td-label' align="left">
                  <table align="left">
                    <tr>
                      <td>(<input type="checkbox" name="">)เลี้ยงสัตว์</td>
                      <td>สัตว์ที่เลี้ยง</td>
                      <td><input type="text" name="career[herdsman_type]">&nbsp;&nbsp;</td>
                      <td>จำนวน</td>
                      <td><input type="text" name="career[herdsman_amount]"></td>
                      <td>ตัว&nbsp;&nbsp;</td>
                      <td>ผลผลิต</td>
                      <td><input type="text" name="career[herdsman_product]"></td>
                      <td>ตัว/ปี</td>
                    </tr>
                  </table>
                </TD>
              </TR>
              <TR>
                <TD class='td-label' align="left">
                  <table align="left">
                    <tr>
                      <td>(<input type="checkbox" name="">)แปรรูปผลผลิต</td>
                      <td></td>
                      <td><input type="text" name="career[tranform_type]">&nbsp;&nbsp;</td>
                      <td>จำนวน</td>
                      <td><input type="text" name="career[tranform_amount]"></td>
                      <td>กิโลกรัม&nbsp;&nbsp;</td>
                      <td>ผลผลิต/ปี</td>
                      <td><input type="text" name="career[tranform_product]"></td>
                      <td>กิโลกรัม</td>
                    </tr>
                  </table>
                </TD>
              </TR>
              <TR>
                <TD class='td-label' align="left">
                  <table align="left">
                    <tr>
                      <td>(<input type="checkbox" name="">)การจับสัตว์น้ำ</td>
                      <td></td>
                      <td><input type="text" name="career[fisherman_type]">&nbsp;&nbsp;</td>
                      <td>ผลผลิตที่ได้รับ</td>
                      <td><input type="text" name="career[fisherman_amount]"></td>
                      <td>ตัน/ปี&nbsp;&nbsp;</td>
                      <td></td>
                      <td></td>
                      <td></td>
                    </tr>
                  </table>
                </TD>
              </TR>
              <TR>
                <TD class='td-label' align="left">
                  <table align="left">
                    <tr>
                      <td>(<input type="checkbox" name="">)อื่นๆ</td>
                      <td></td>
                      <td><input type="text" name="career[other_type]">&nbsp;&nbsp;</td>
                      <td>จำนวน</td>
                      <td><input type="text" name="career[other_amount]"></td>
                      <td>ไร่&nbsp;&nbsp;</td>
                      <td>ผลผลิต</td>
                      <td><input type="text" name="career[other_product]"></td>
                      <td>กิโลกรัม/ปี</td>
                    </tr>
                  </table>
                </TD>
              </TR>

            </TABLE>
          
      </TD>
    </TR>
  <tr>
    <td>&nbsp;</td>
  </tr>
    <TR>
      <TD valign="top" border="1">
          <TABLE width='100%' border="0" align="left">
            <TR>
              <TD class='td-label' align="left">
                 <b><u><font size="4" color="">
                    ส่วนที่ 3 สภาพปัญหาจากการประกอบอาชีพ
                  </font></u></b>
              </TD>
            </TR>
            <TR>
              <TD class='td-label' align="left">
                &nbsp;&nbsp;1.<input size="50" type="text" name="career_problem[0][detail]">
              </TD>
            </TR>
            <TR>
              <TD class='td-label' align="left">
                &nbsp;&nbsp;2.<input size="50" type="text" name="career_problem[1][detail]">
              </TD>
            </TR>
            <TR>
              <TD class='td-label' align="left">
                &nbsp;&nbsp;3.<input size="50" type="text" name="career_problem[2][detail]">
              </TD>
            </TR>
            <TR>
              <TD class='td-label' align="left">
                &nbsp;&nbsp;4.<input size="50" type="text" name="career_problem[3][detail]">
              </TD>
            </TR>
            <TR>
              <TD class='td-label' align="left">
                &nbsp;&nbsp;5.<input size="50" type="text" name="career_problem[4][detail]">
              </TD>
            </TR>
          </TABLE>
      </TD>
    </TR>
  <tr>
    <td>&nbsp;</td>
  </tr>
    <TR>
      <TD valign="top" border="1">
          
            <TABLE width='100%' border="0" align="left">
              <TR>
                <TD class='td-label' align="left">
                   <b><u><font size="4" color="">
                      ส่วนที่ 4 แผนการฟื้นฟูพัฒนาอาชีพ (แนวทางในการแก้ไข)
                    </font></u></b>
                </TD>
              </TR>
              <TR>
                <TD class='td-label' align="left">
                  &nbsp;&nbsp;1.<input size="50" type="text" name="career_solve[0][detail]">
                </TD>
              </TR>
              <TR>
                <TD class='td-label' align="left">
                  &nbsp;&nbsp;2.<input size="50" type="text" name="career_solve[1][detail]">
                </TD>
              </TR>
              <TR>
                <TD class='td-label' align="left">
                  &nbsp;&nbsp;3.<input size="50" type="text" name="career_solve[2][detail]">
                </TD>
              </TR>
              <TR>
                <TD class='td-label' align="left">
                  &nbsp;&nbsp;4.<input size="50" type="text" name="career_solve[3][detail]">
                </TD>
              </TR>
              <TR>
                <TD class='td-label' align="left">
                  &nbsp;&nbsp;5.<input size="50" type="text" name="career_solve[4][detail]">
                </TD>
              </TR>
            </TABLE>
          
      </TD>
    </TR>
  <tr>
    <td>&nbsp;</td>
  </tr>
    <TR>
      <TD valign="top" border="1">
          
          <TABLE width='100%' border="1" align="left">
            <TR>
              <TD class='td-label' align="left" colspan="4">
                 <b><u><font size="4" color="">
                    ส่วนที่ 5 รายได้/ค่าใช้จ่าย
                  </font></u></b>
              </TD>
            </TR>
            <tr>
              <th>ประเภท</th>
              <th>รายละเอียด</th>
              <th>ปริมาณผลผลิต/ปี</th>
              <th>รายได้/บาท/ปี</th>
            </tr>
            <tr>
              <th rowspan="4" valign="top">รายได้</th>
              <th>1.รายได้หลัีกจากอาชีพเกษตรกรรม</th>
              <th></th>
              <th></th>
            </tr>
            <tr>
              <td>1.1<input size="50" type="text" name="income[0][main_career_title]"></td>
              <td><input type="text" name="income[0][main_career_amount]"></td>
              <td><input type="text" name="income[0][main_career_income]"></td>
            </tr>
            <tr>
              <td>1.2<input size="50"  type="text" name="income[1][main_career_title]"></td>
              <td><input type="text" name="income[1][main_career_amount]"></td>
              <td><input type="text" name="income[1][main_career_income]"></td>
            </tr>
            <tr>
              <td>1.3<input size="50"  type="text" name="income[2][main_career_title]"></td>
              <td><input type="text" name="income[2][main_career_amount]"></td>
              <td><input type="text" name="income[2][main_career_income]"></td>
            </tr>
            <tr>
              <th rowspan="4" valign="top"></th>
              <th>2.รายได้จากอาชีพนอกภาคเกษตรกรรม</th>
              <th>ปริมาณผลผลิต/ตัน/ปี</th>
              <th>รายได้/บาท/ปี</th>
            </tr>
            <tr>
              <td>2.1<input size="50"  type="text" name="income[0][sub_career_title]"></td>
              <td><input type="text" name="income[0][sub_career_amount]"></td>
              <td><input type="text" name="income[0][sub_career_income]"></td>
            </tr>
            <tr>
              <td>2.2<input size="50"  type="text" name="income[1][sub_career_title]"></td>
              <td><input type="text" name="income[1][sub_career_amount]"></td>
              <td><input type="text" name="income[1][sub_career_income]"></td>
            </tr>
            <tr>
              <td>2.3<input size="50"  type="text" name="income[2][sub_career_title]"></td>
              <td><input type="text" name="income[2][sub_career_amount]"></td>
              <td><input type="text" name="income[2][sub_career_income]"></td>
            </tr>
            <tr>
              <th></th>
              <th align="center">รวมรายได้ทั้งสิ้น</th>
              <th></th>
              <th><input type="text" name=""></th>
            </tr>
            <tr>
              <th rowspan="12" valign="top">ค่าใช้จ่าย</th>
              <th>1.ค่าใช้จ่ายในการประกอบอาชีพเกษตรกรรม</th>
              <th>พื้นที่ทำการเกษตร/ไร่/ปี</th>
              <th>รายจ่าย/บาท/ปี</th>
            </tr>
            <tr>
              <td>1.1<input size="50"  type="text" name="outlay[0][main_career_title]"></td>
              <td><input type="text" name="outlay[0][main_career_amount]"></td>
              <td><input type="text" name="outlay[0][main_career_income]"></td>
            </tr>
            <tr>
              <td>1.2<input size="50"  type="text" name="outlay[1][main_career_title]"></td>
              <td><input type="text" name="outlay[1][main_career_amount]"></td>
              <td><input type="text" name="outlay[1][main_career_income]"></td>
            </tr>
            <tr>
              <td>1.3<input size="50"  type="text" name="outlay[2][main_career_title]"></td>
              <td><input type="text" name="outlay[2][main_career_amount]"></td>
              <td><input type="text" name="outlay[2][main_career_income]"></td>
            </tr>
            <tr>
              <th>2.ค่าใช้จ่ายในการประกอบอาชีพนอกภาคเกษตรกรรม</th>
              <th></th>
              <th></th>
            </tr>
            <tr>
              <td>2.1<input size="50"  type="text" name="outlay[0][sub_career_title]"></td>
              <td><input type="text" name="outlay[0][sub_career_amount]"></td>
              <td><input type="text" name="outlay[0][sub_career_income]"></td>
            </tr>
            <tr>
              <td>2.2<input size="50"  type="text" name="outlay[1][sub_career_title]"></td>
              <td><input type="text" name="outlay[1][sub_career_amount]"></td>
              <td><input type="text" name="outlay[1][sub_career_income]"></td>
            </tr>
            <tr>
              <td>2.3<input size="50"  type="text" name="outlay[2][sub_career_title]"></td>
              <td><input type="text" name="outlay[2][sub_career_amount]"></td>
              <td><input type="text" name="outlay[2][sub_career_income]"></td>
            </tr>
            <tr>
              <td><b>3.ค่าใช้จ่ายในครัวเรือน อาทิ</b> (ค่าน้ำ, ค่าไฟ, ค่ากับข้าว, อื่นๆ)</td>
              <th></th>
              <th></th>
            </tr>
            <tr>
              <td>3.1<input size="50"  type="text" name="outlay[0][household_career_title]"></td>
              <td><input type="text" name="outlay[0][household_career_amount]"></td>
              <td><input type="text" name="outlay[0][household_career_income]"></td>
            </tr>
            <tr>
              <td>3.2<input size="50"  type="text" name="outlay[1][household_career_title]"></td>
              <td><input type="text" name="outlay[1][household_career_amount]"></td>
              <td><input type="text" name="outlay[1][household_career_income]"></td>
            </tr>
            <tr>
              <td>3.3<input size="50"  type="text" name="outlay[2][household_career_title]"></td>
              <td><input type="text" name="outlay[2][household_career_amount]"></td>
              <td><input type="text" name="outlay[2][household_career_income]"></td>
            </tr>
            <tr>
              <th></th>
              <th align="center">รวมรายจ่ายทั้งสิ้น</th>
              <th></th>
              <th><input type="text" name=""></th>
            </tr>
            <tr>
              <th></th>
              <th align="center">เหลือสุทธิ = (รายได้ - รายจ่าย)</th>
              <th></th>
              <th><input type="text" name=""></th>
            </tr>
          </table>
      </TD>
    </TR>
  <tr>
    <td>&nbsp;</td>
  </tr>
    <TR>
      <TD valign="top" border="1">
          <TABLE width='100%' border="0" align="left">
            <TR>
              <TD class='td-label' align="left">
                 <b><u><font size="4" color="">
                    ส่วนที่ 6 สภาพปัญหาทั่วไป
                  </font></u></b>
              </TD>
            </TR>
            <TR>
              <TD class='td-label' align="left">
                &nbsp;&nbsp;1.<input size="50" type="text" name="general_problem[0][problem]">
              </TD>
            </TR>
            <TR>
              <TD class='td-label' align="left">
                &nbsp;&nbsp;2.<input size="50" type="text" name="general_problem[1][problem]">
              </TD>
            </TR>
            <TR>
              <TD class='td-label' align="left">
                &nbsp;&nbsp;3.<input size="50" type="text" name="general_problem[2][problem]">
              </TD>
            </TR>
            <TR>
              <TD class='td-label' align="left">
                &nbsp;&nbsp;4.<input size="50" type="text" name="general_problem[3][problem]">
              </TD>
            </TR>
            <TR>
              <TD class='td-label' align="left">
                &nbsp;&nbsp;5.<input size="50" type="text" name="general_problem[4][problem]">
              </TD>
            </TR>
            <TR>
              <TD class='td-label' align="left">
                &nbsp;&nbsp;6.<input size="50" type="text" name="general_problem[5][problem]">
              </TD>
            </TR>
          </TABLE>
      </TD>
    </TR>
  <tr>
    <td>&nbsp;</td>
  </tr>
    <TR>
      <TD valign="top" border="1">
          <TABLE width='100%' border="0" align="left">
            <TR>
              <TD class='td-label' align="left">
                 <b><u><font size="4" color="">
                    แนวทางในการแก้ปัญหา
                  </font></u></b>
              </TD>
            </TR>
            <TR>
              <TD class='td-label' align="left">
                &nbsp;&nbsp;1.<input size="50" type="text" name="general_solve[0][solve]">
              </TD>
            </TR>
            <TR>
              <TD class='td-label' align="left">
                &nbsp;&nbsp;2.<input size="50" type="text" name="general_solve[1][solve]">
              </TD>
            </TR>
            <TR>
              <TD class='td-label' align="left">
                &nbsp;&nbsp;3.<input size="50" type="text" name="general_solve[2][solve]">
              </TD>
            </TR>
            <TR>
              <TD class='td-label' align="left">
                &nbsp;&nbsp;4.<input size="50" type="text" name="general_solve[3][solve]">
              </TD>
            </TR>
            <TR>
              <TD class='td-label' align="left">
                &nbsp;&nbsp;5.<input size="50" type="text" name="general_solve[4][solve]">
              </TD>
            </TR>
            <TR>
              <TD class='td-label' align="left">
                &nbsp;&nbsp;6.<input size="50" type="text" name="general_solve[5][solve]">
              </TD>
            </TR>
          </TABLE>
      </TD>
    </TR>

  </TABLE>
  <TABLE width="100%" align="left">
    <TR>
      <TD valign="top" width="100%">
          
          <legend>&nbsp;Map information&nbsp;</legend>
          <body>
            <style>
            #mapCanvas {
              width: 100%;
              height: 600px;
              float: left;
            }
            #infoPanel {
              float: left;
              margin-left: 10px;
            }
            #infoPanel div {
              margin-bottom: 5px;
            }
            </style>
            <div id="mapCanvas"></div>
      </TD>
    </TR>
  </TABLE>

  <table width="100%" align="left">
    <tr>
      <td>
      <hr>
      <div id="infoPanel">
        <b>Marker status:</b>
        <div id="markerStatus"><i>Click and drag the marker.</i></div>
        <b>Current position:</b>
        <div id="info"></div>
        <b>Closest matching address:</b>
        <div id="address"></div>
      </div>
      </td>
    </tr>
    <TR>
      <TD class='td-label' align="left">latitude&nbsp;:&nbsp;</TD>
    </TR>
    <TR>
      <TD align="left">
        <input id="latitude" 
              type="text" 
              name="form[latitude]" 
              value="<!--[$form.latitude]-->" 
              title="latitude" 
              class="required" 
              size="25"  
        />
        <FONT SIZE="2" COLOR="#FF0000">&nbsp;*</FONT>
        <span id='error-latitude'></span>
      </TD>
    </TR>
    <TR>
        <TD class='td-label' align="left">longitude&nbsp;:&nbsp;</TD>
    </TR>
    <TR>
      <TD align="left">
        <input id="longitude" 
              type="text" 
              name="form[longitude]" 
              value="<!--[$form.longitude]-->" 
              title="longitude" 
              class="required" 
              size="25" 
        />
        <FONT SIZE="2" COLOR="#FF0000">&nbsp;*</FONT>
        <span id='error-longitude'></span>
      </TD>
    </TR>
    <TR>
      <TD align="left" width="100%">
        <INPUT TYPE="submit"  value="บันทึกข้อมูล">
        <input type="button" 
                name="Cancel" 
                value="ยกเลิก" 
                onclick="window.location = '<!--[pnmodurl modname='VotePetition']-->' " 
        />
      </TD>
    </TR>
  </table>
  </form><BR>
<!--[/securityutil_checkpermission_block]-->
